<template>
    <div class="page" data-page="ninePlaceDetail" style="z-index: 2;">
        <div class="link-page-nav">
            <a href="#" class="link" @click="$root.backToTab()"> 
                <i class="iconfont icon-zuo"></i>
            </a>
        </div>
        <div class="link-page-top" style="padding-bottom: 17px;">
            <div class="link-page-title" id="banner-title_{{getNewId}}"></div>
        </div>
        <div class="page-content" id="banner-pic_{{getNewId}}" style="height: calc(100% - 91px);width: calc(100% - 40px);"></div>
        <!-- <div class="banner-pic" id="banner-pic" style="height: calc(100% - 91px);width: calc(100% - 40px);"></div> -->
    </div>
</template>
<script>
    return {
        data: function () {
            return {
                getNewId: (new Date()).getTime(),
            }
        },
        methods: {
          //公告详情
          getBannerDetail:function(noticeId){
            let self = this;
            var listimg = [];
            var html = "";
            Dao.getNineNoticeDetail({
                noticeId:noticeId
            },function(data){
                this.listimg = String(data.detailImg).split(",");
                if(data){
                  $("#banner-title_"+self.getNewId).empty();
                  $("#banner-pic_"+self.getNewId).empty();
                  $("#banner-title_"+self.getNewId).append(data.name);
                    if(data.contentType==1){
                        for (var i = 0; i < this.listimg.length; i++) {
                            $("#banner-pic_"+self.getNewId).append(`<img src="`+ listNoDataPic(this.listimg[i])+`" alt="" style="width:100%;">`);
                        }
                    }else{
                        $("#banner-pic_"+self.getNewId).append(data.content);
                    }
                    jQuery("#banner-pic_"+self.getNewId+" img").off().click(function() {
                        var picUrl = $(this).attr("src").split(",");
                        openAndShowBigImage([picUrl],0);
                    });
                }
            });
          },
        },
        on: {
            pageInit: function (e, page) {
                this.$route.params.nid
                var self = this;
                self.getBannerDetail(this.$route.params.nid);
            }
        }
        
    }
</script>

<style scoped>
    .page-content{
        margin-left: 20px;
    }
    .page-content img{
        width: 100%;
    }
</style>